# -*- mode: python -*-


import os
import sys

os.chdir("F:\\develop\\bloodnica\\")
sys.path.insert(0,os.path.abspath(os.path.join(os.path.curdir,"utils")))
print sys.path

from dist import rec_files

images_pth = os.path.join(os.path.abspath(os.curdir),"images")
my_datas = [("phonon_backend/phonon_ds94.dll",'phonon_backend/phonon_ds94.dll','DATA'),
    ("imageformats/qgif4.dll",'imageformats/qgif4.dll','DATA'),
    ("imageformats/qico4.dll",'imageformats/qico4.dll','DATA'),
    ("imageformats/qjpeg4.dll",'imageformats/qjpeg4.dll','DATA'),
    ("imageformats/qmng4.dll",'imageformats/qmng4.dll','DATA'),
    ("imageformats/qsvg4.dll",'imageformats/qsvg4.dll','DATA'),
    ("imageformats/qtiff4.dll",'imageformats/qtiff4.dll','DATA'),
    ('images/ui/balance_panel.png', 'images/ui/balance_panel.png', 'DATA'),('BalancePanel.qml', 'BalancePanel.qml', 'DATA'),('BankPanel.qml', 'BankPanel.qml', 'DATA'),('Card.qml', 'Card.qml', 'DATA'),('ChatPanel.qml', 'ChatPanel.qml', 'DATA'),  ('main.qml', 'main.qml', 'DATA'), ('Sprite.qml', 'Sprite.qml', 'DATA'),('ToolTip.qml', 'ToolTip.qml', 'DATA'),('VideoPanel.qml', 'VideoPanel.qml', 'DATA')]

new_datas = rec_files(os.path.join(os.curdir,"images"))
out_datas = []
for i in new_datas:
    out_datas.append((i,i,'DATA'))
my_datas.extend(out_datas)

new_datas = rec_files(os.path.join(os.curdir,"videos"))
out_datas = []
for i in new_datas:
    out_datas.append((i,i,'DATA'))
my_datas.extend(out_datas)


a = Analysis([os.path.join(HOMEPATH,'support\\_mountzlib.py'), os.path.join(HOMEPATH,'support\\useUnicode.py'), './main.py'],
             pathex=['F:\\develop\\bloodnica'])
pyz = PYZ(a.pure)
exe = EXE(pyz,
          a.scripts,
          exclude_binaries=1,
          name=os.path.join('build\\pyi.win32\\main', 'main.exe'),
          debug=False,
          strip=False,
          upx=True,
          console=True )
coll = COLLECT( exe,
               a.binaries,
               a.zipfiles,
               a.datas+my_datas,
               strip=False,
               upx=True,
               name=os.path.join('dist', 'dist_output'))
